import { PyInput as Input, PyInputType } from "./PyInput";
import { PyInputNumber as InputNumber, PyInputNumberType } from "./PyInputNumber";
import { PySelectType, PySelect as Select } from "./PySelect";
import { PyDatePickerVue as DatePicker, DatePickerConf } from "./PyDatePicker";
import { PyTimePickerVue as TimePicker, TimePickerConf } from "./PyTimePicker";
import { PyUploadImgType, PyUploadImg as UploadImg } from "./PyUploadImg";
import { PyUploadFileType, PyUploadFile as UploadFile } from "./PyUploadFile";
import { PyButton as Button } from "./PyButton";
import { PyTextAreaType, PyTextArea as TextArea } from "./PyTextArea";
import { PySwitchType, PySwitch as Switch } from "./PySwitch";
import { PyEditor as Editor, PyEditorProps } from "./PyEditor";
import { PyMap as Map, MapOptions } from "./PyMap";
import { PySearchType, PySearch as Search } from "./PySearch";
import { PyCascader as Cascader, CascaderType } from "./PyCascader";
import { PySelectGroup as SelectGroup, PySelectGroupType } from "./PySelectGroup";
import { PyInputGroup as InputGroup, type PyInputGroupType } from "./PyInputGroup";
import { PyTreeSelect as TreeSelect, type PyTreeSelectType } from "./PyTreeSelect";
export * from "./PyButton";
export * from "./PyDatePicker";
export * from "./PyEditor";
export * from "./PyInput";
export * from "./PyInputNumber";
export * from "./PyMap";
export * from "./PySearch";
export * from "./PySelect";
export * from "./PySwitch";
export * from "./PyTextArea";
export * from "./PyUploadImg";
export * from "./PyCascader";
export * from "./PyInputGroup";
export * from "./PySelectGroup";
export * from "./PyTimePicker";
// 导出即可在表单种使用
const FormChildComp = {
	Input,
	InputNumber,
	Select,
	DatePicker,
	TimePicker,
	UploadImg,
	UploadFile,
	TextArea,
	Switch,
	Editor,
	Map,
	Cascader,
	InputGroup,
	Search,
	TreeSelect,
	SelectGroup,
};
export type FormItemComponentKeyType = keyof typeof FormChildComp;
export type FilterFormItemOptions<T> = Omit<T, "placeholder" | "disabled">;
export type FormItemComponentType =
	| {
			component: "Input";
			conf?: FilterFormItemOptions<PyInputType>;
	  }
	| {
			component: "Select";
			conf?: FilterFormItemOptions<PySelectType>;
	  }
	| {
			component: "InputNumber";
			conf?: FilterFormItemOptions<PyInputNumberType>;
	  }
	| {
			component: "DatePicker";
			conf?: FilterFormItemOptions<DatePickerConf>;
	  }
	// | {
	// 		componemt: "TimePicker";
	// 		conf: FilterFormItemOptions<TimePickerConf>;
	//   }
	| {
			component: "Switch";
			conf?: FilterFormItemOptions<PySwitchType>;
	  }
	| {
			component: "UploadImg";
			conf?: FilterFormItemOptions<PyUploadImgType>;
	  }
	| {
			component: "UploadFile";
			conf?: FilterFormItemOptions<PyUploadFileType>;
	  }
	| {
			component: "TextArea";
			conf?: FilterFormItemOptions<PyTextAreaType>;
	  }
	| {
			component: "Editor";
			conf?: FilterFormItemOptions<PyEditorProps>;
	  }
	| {
			component: "Map";
			conf?: FilterFormItemOptions<MapOptions>;
	  }
	| {
			component: "Cascader";
			conf?: FilterFormItemOptions<CascaderType>;
	  }
	| {
			component: "InputGroup";
			conf?: FilterFormItemOptions<PyInputGroupType>;
	  }
	| {
			component: "Search";
			conf?: FilterFormItemOptions<PySearchType>;
	  }
	| {
			component: "TreeSelect";
			conf?: FilterFormItemOptions<PyTreeSelectType>;
	  }
	| {
			component: "SelectGroup";
			conf?: FilterFormItemOptions<PySelectGroupType>;
	  }
	| {
			component: "TimePicker";
			conf?: FilterFormItemOptions<TimePickerConf>;
	  };

export type FormItemCompoentKey = keyof typeof FormChildComp;

export {
	Input,
	InputNumber,
	Select,
	DatePicker,
	TimePicker,
	UploadImg,
	Button,
	TextArea,
	Switch,
	Editor,
	Map,
	Cascader,
	InputGroup,
	Search,
	SelectGroup,
};

export { FormChildComp };
